<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/11/10
 * Time: 16:00
 * Project name: PHPTEST
 * File name: 2.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */
$path = 'E:\Workspace\PHP\GIT\MY\WWW\PHPTEST\2016\11\09\fun.php';
include_once $path;




br("date_add() 函数添加日、月、年、时、分和秒到一个日期。");
$date=date_create("2013-03-15");

$dateTimeZone = $date->getTimezone();
var_dump($dateTimeZone);

//$dateInterval = DateInterval::createFromDateString("2013-03-15");
//var_dump($dateInterval);
date_add($date,date_interval_create_from_date_string("40 days"));


date_add($date,DateInterval::createFromDateString("40 days"));



echo date_format($date,"Y-m-d");
br();
br("checkdate() 函数用于验证格利高里日期。");
var_dump(checkdate(12,31,-400));
echo "<br>";
var_dump(checkdate(2,29,2003));
echo "<br>";
var_dump(checkdate(2,29,2004));